package com.flynn.rock.model.dto.system;

import com.flynn.rock.enums.system.AuthorityStatus;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "权限信息")
public class AuthorityDto implements GrantedAuthority  {

    @Schema(description = "权限ID")
    private Long authorityId;

    @Schema(description = "权限名称")
    private String authorityName;

    @Schema(description = "权限码")
    private String authorityCode;

    @Schema(description = "权限状态")
    private AuthorityStatus authorityStatus;

    @Override
    public String getAuthority() {
        return authorityCode;
    }
}
